home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / esc.jar / com / extensibility / xa / undo / ExternalEntPublicUndoable.class (.txt) < prev    next >
Encoding:
Java Class File  |  2000-06-30  |  1.8 KB  |  49 lines

  1. package com.extensibility.xa.undo;
  2.  
  3. import com.extensibility.app.UI;
  4. import com.extensibility.xa.EntityModel;
  5. import com.extensibility.xa.XADesktop;
  6. import com.extensibility.xml.BaseDeclaration;
  7. import com.extensibility.xml.EntityDeclaration;
  8.  
  9. public class ExternalEntPublicUndoable extends DeclTableUndoable {
  10.    EntityDeclaration entityDecl;
  11.  
  12.    public ExternalEntPublicUndoable(EntityModel var1, BaseDeclaration var2, Object var3) {
  13.       super(XADesktop.getTableForModel(var1), var2, var3);
  14.       this.entityDecl = (EntityDeclaration)var2;
  15.       super.oldValue = ((EntityModel)super.tableModel).getValueAt(super.tableModel.getRowForDecl(this.entityDecl), 4);
  16.    }
  17.  
  18.    public String getPresentationName() {
  19.       return ((EntityModel)super.tableModel).isGE() ? UI.getString("undo.xge.pub") : UI.getString("undo.xpe.pub");
  20.    }
  21.  
  22.    public void undo() {
  23.       super.undo();
  24.       String var1 = super.oldValue == null ? "" : (String)super.oldValue;
  25.       if (var1.length() == 0) {
  26.          this.entityDecl.setPublicID((String)null);
  27.       } else {
  28.          this.entityDecl.setPublicID(var1);
  29.       }
  30.  
  31.       ((DeclTableUndoable)this).setCellFocus(super.tableModel.getRowForDecl(this.entityDecl), 4);
  32.    }
  33.  
  34.    public void doCommand() {
  35.       if (((String)super.newValue).length() == 0) {
  36.          this.entityDecl.setPublicID((String)null);
  37.       } else {
  38.          this.entityDecl.setPublicID((String)super.newValue);
  39.       }
  40.  
  41.    }
  42.  
  43.    public void redo() {
  44.       super.redo();
  45.       this.doCommand();
  46.       ((DeclTableUndoable)this).setCellFocus(super.tableModel.getRowForDecl(this.entityDecl), 4);
  47.    }
  48. }
  49.